@extends('layouts.app')
@section('content')
<div class="layui-form" lay-filter="layuiadmin-form-categories" id="layuiadmin-app-form-categories">
    <div class="layui-form-item">
        <label class="layui-form-label">上级分类</label>
        <div class="layui-input-inline">
            <script id="tpl_parent_id" type="text/html" template lay-url="{{ layui.setter.host }}/article_category" lay-done="layui.form.render('select');">
                <select name="parent_id" lay-verify="required" lay-search="">
                    <option value="0">顶级分类</option>
                    {{# layui.each(d.data, function(index, item){ }}
                    <option value="{{item.id}}" {{ d.params.parent_id === item.id ? 'selected' : '' }}>{{item.name}}</option>
                    {{# }); }}
                </select>
            </script>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">分类名称</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <input type="text" name="name" value="{{ d.params.name || '' }}" lay-verify="required" placeholder="请输入..." autocomplete="off" class="layui-input">
            </script>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">分类图标</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <input type="text" name="icon" value="{{ d.params.icon || '' }}"
                       placeholder="请选择图片" autocomplete="off" class="layui-input">
            </script>
        </div>
        <button style="float: left;" type="button" class="layui-btn" layadmin-event="select_image">选择图片</button>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <input type="number" name="sort" value="{{ d.params.sort || 0 }}" lay-verify="required" placeholder="请输入..." autocomplete="off" class="layui-input">
            </script>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <select name="status" lay-verify="required">
                    <option value="1" {{ d.params.status == '1' ? 'selected' : '' }}>启用</option>
                    <option value="0" {{ d.params.status == '0' ? 'selected' : '' }}>禁用</option>
                </select>
            </script>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-inline">
            <input type="button" lay-submit lay-filter="layuiadmin-app-categories-submit" value="确认" class="layui-btn">
        </div>
    </div>
</div>
@endsection
